package com.ruoyi.system.service.impl;

import com.ruoyi.common.core.domain.entity.system.BoatMachineWorkingInfo;
import com.ruoyi.system.mapper.BoatMachineWorkingInfoMapper;
import com.ruoyi.system.service.IBoatMachineWorkingInfoService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

/**
 * 船舶工况信息Service业务层处理
 *
 * @author zjw
 * @date 2024-01-19
 */
@Service
public class BoatMachineWorkingInfoServiceImpl implements IBoatMachineWorkingInfoService {
    @Resource
    private BoatMachineWorkingInfoMapper boatMachineWorkingInfoMapper;

    /**
     * 查询船舶工况信息
     *
     * @param id 船舶工况信息主键
     * @return 船舶工况信息
     */
    @Override
    public BoatMachineWorkingInfo selectBoatMachineWorkingInfoById(Long id) {
        return boatMachineWorkingInfoMapper.selectBoatMachineWorkingInfoById(id);
    }

    /**
     * 查询船舶工况信息列表
     *
     * @param boatMachineWorkingInfo 船舶工况信息
     * @return 船舶工况信息
     */
    @Override
    public List<BoatMachineWorkingInfo> selectBoatMachineWorkingInfoList(BoatMachineWorkingInfo boatMachineWorkingInfo) {
        return boatMachineWorkingInfoMapper.selectBoatMachineWorkingInfoList(boatMachineWorkingInfo);
    }

    /**
     * 新增船舶工况信息
     *
     * @param boatMachineWorkingInfo 船舶工况信息
     * @return 结果
     */
    @Override
    public int insertBoatMachineWorkingInfo(BoatMachineWorkingInfo boatMachineWorkingInfo) {
//        boatMachineWorkingInfo.setCreateTime(DateUtils.getNowDate());
        return boatMachineWorkingInfoMapper.insertBoatMachineWorkingInfo(boatMachineWorkingInfo);
    }

    /**
     * 修改船舶工况信息
     *
     * @param boatMachineWorkingInfo 船舶工况信息
     * @return 结果
     */
    @Override
    public int updateBoatMachineWorkingInfo(BoatMachineWorkingInfo boatMachineWorkingInfo) {
        return boatMachineWorkingInfoMapper.updateBoatMachineWorkingInfo(boatMachineWorkingInfo);
    }

    /**
     * 批量删除船舶工况信息
     *
     * @param ids 需要删除的船舶工况信息主键
     * @return 结果
     */
    @Override
    public int deleteBoatMachineWorkingInfoByIds(Long[] ids) {
        return boatMachineWorkingInfoMapper.deleteBoatMachineWorkingInfoByIds(ids);
    }

    /**
     * 删除船舶工况信息信息
     *
     * @param id 船舶工况信息主键
     * @return 结果
     */
    @Override
    public int deleteBoatMachineWorkingInfoById(Long id) {
        return boatMachineWorkingInfoMapper.deleteBoatMachineWorkingInfoById(id);
    }
}
